<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Postcat - Open Source API Ecosystem</title>
    <base href="/" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script async src="assets/font/iconpark.js"></script>
    <link rel="icon" type="image/x-icon" href="assets/icons/iconLogo.png" />
    <style>
      #mask {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        z-index: 99999;
        display: none;
      }

      .loading-container {
        position: absolute;
        top: 40%;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
      }

      .loading-container img {
        width: 100px;
      }

      .loading-container .iconpark-icon.loading-icon {
        color: var(--text-color);
        margin-top: 15px;
        height: 25px;
        width: 25px;
        vertical-align: middle;
        animation: loading-circle 1s infinite linear;
      }
      @keyframes loading-circle {
        to {
          transform: rotate(360deg);
        }
      }
    </style>
  </head>
  <!-- Angular Cli need for node modules -->
  <script>
    var global = global || window;
    var Buffer = Buffer || [];
    var process = process || {
      env: { DEBUG: undefined },
      version: []
    };
  </script>

  <body>
    <eo-root></eo-root>
    <div id="mask"></div>
    <div id="first-screen-loading-container" class="loading-container">
      <img src="assets/images/logo.svg" />
      <svg class="iconpark-icon loading-icon">
        <use href="#loading"></use>
      </svg>
    </div>
  </body>
  <script>
    if (window.location.hostname === 'www.postcat.com') {
      window.location.href = 'https://postcat.com';
    }
  </script>
  <script type="text/javascript" async>
    if (!!window.electron && !window.location.href.includes('http://localhost')) {
      window._gr_ignore_local_rule = true; // * Open local collection
    }
    !(function (e, t, n, g, i) {
      (e[i] =
        e[i] ||
        function () {
          (e[i].q = e[i].q || []).push(arguments);
        }),
        (n = t.createElement('script')),
        (tag = t.getElementsByTagName('script')[0]),
        (n.async = 1),
        (n.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + g),
        tag.parentNode.insertBefore(n, tag);
    })(window, document, 'script', 'assets.giocdn.com/2.1/gio.js', 'gio');
    gio('init', 'bd7645ddc19400a8', {});
    //custom page code begin here

    //Electron use hash mode
    if (!!window.electron) {
      gio('config', { hashtag: true });
    }
    //custom page code end here
    gio('send');
  </script>

  <script>
    const rootEl = document.querySelector('eo-root');
    const loadingEl = document.querySelector('#first-screen-loading-container');
    // 观察器的配置（需要观察什么变动）
    const config = { childList: true, subtree: true };
    // 当观察到变动时执行的回调函数
    const callback = function (mutationsList, observer) {
      // Use traditional 'for loops' for IE 11
      for (let mutation of mutationsList) {
        if (mutation.type === 'childList' && rootEl.childElementCount > 1) {
          loadingEl.remove();
          // 之后，可停止观察
          observer.disconnect();
        }
      }
    };
    // 创建一个观察器实例并传入回调函数
    const observer = new MutationObserver(callback);
    // 以上述配置开始观察目标节点
    observer.observe(rootEl, config);
  </script>
</html>
